

package threads;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import robot.DBComm;


public class SharedVisionThread implements Runnable {
public static boolean run = false;
    public SharedVisionThread() {}

    public void run() {
        run = true;
        while(run) {
            if (QueueClient.position == 1) {
                try {
                    DBComm.setSharedVision();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            } else if (QueueClient.position > 1) {
                DBComm.getSharedVision();
            }
            try {
                Thread.sleep(2000);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }
    }
}
